import request from '@/utils/request'

// 角色权限

/**
 * 获取列表
 *
 * @export
 * @param {*} data  { orgId }
 * @returns
 */
export function fetchRoleFindPage(data) {
  return request({
    url: '/pc/base/role/findPage',
    method: 'post',
    data
  })
}

/**
 * 获取详情
 *
 * @export
 * @param {*} data { id }
 * @returns
 */
export function fetchRoleGet(params) {
  return request({
    url: '/pc/base/role/get',
    method: 'get',
    params
  })
}

/**
 * 添加
 *
 * @export
 * @param {*} data { name, remark, status, isAdmin, roleType, rightStr, rightDataType, orgIds, deptIds }
 * @returns
 */
export function fetchRoleAdd(data) {
  return request({
    url: '/pc/base/role/add',
    method: 'post',
    data
  })
}

/**
 * 更新
 *
 * @export
 * @param {*} data { id, name, remark, status, isAdmin, roleType, rightStr, rightDataType, orgIds, deptIds }
 * @returns
 */
export function fetchRoleUpdate(data) {
  return request({
    url: '/pc/base/role/update',
    method: 'post',
    data
  })
}

/**
 * 删除
 *
 * @export
 * @param {*} data { id }
 * @returns
 */
export function fetchRoleDelete(params) {
  return request({
    url: '/pc/base/role/delete',
    method: 'post',
    params
  })
}
